#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    _yuvPlayer = new YUVPlayer(this);

    int playerWidth = 500;
    int playerHeight = 500;

    _yuvPlayer->setGeometry((this->width() - playerWidth) >> 1,(this->height() - playerHeight) >> 1,playerWidth,playerHeight);
  //1916 × 1086
    YUVFileSpec yuvFileSpec(1916,1086,30,AV_PIX_FMT_YUV420P,"/Users/tgy/Documents/ffmpeg/video/demo03.yuv");
    _yuvPlayer->init(yuvFileSpec);

    _yuvPlayer->play();
}

MainWindow::~MainWindow()
{
    delete ui;
}

